UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7sso84qMioKatUUtwYnkCccjoOsuluEix9JmTUiwTgQ=' 
WHERE 
  key_id = 'ee9550441d3250afdfd07cd4403fca39afa9a00af6314cb1d7ea2cc930d7f158' 
  AND (
    token = '7sso84qMioKatUUtwYnkCccjoOsuluEix9JmTUiwTgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034