UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LX39CVh2HuYQeewePeHD1WXkmeaw5vZxuJ7QFkU8E6Q=' 
WHERE 
  key_id = '25e0b94641c4e822d96cfc1ac603641b52c8ec779a49a0d9fca1eb585fcbaf1a' 
  AND (
    token = 'LX39CVh2HuYQeewePeHD1WXkmeaw5vZxuJ7QFkU8E6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058