UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UFaPCl77zo3OQ0vrqCKz+RdZSfcTBpTj+xqA0uAGtns=' 
WHERE 
  key_id = 'b6b3e6c3cd5e991f4b878ccdc48215db0f3ba58924997536bf861e811fe6b070' 
  AND (
    token = 'UFaPCl77zo3OQ0vrqCKz+RdZSfcTBpTj+xqA0uAGtns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040