UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AXxhBuKJ5PCoxZ7cQswjS8Kko8w+gwV2GBeXZ7FJ1hU=' 
WHERE 
  key_id = 'a72a0b8138a317702958746eddbbad14b98ea101812afff223d02707a2e52bb6' 
  AND (
    token = 'AXxhBuKJ5PCoxZ7cQswjS8Kko8w+gwV2GBeXZ7FJ1hU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037