UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ureg3NkSpXNmRJjPAEMfcGPA9ZV85WA4jpaJv8d2RMg=' 
WHERE 
  key_id = '60281afff27821403eee6d81d01081b5b32a01fa354cd26d7b415b8b96feb900' 
  AND (
    token = 'ureg3NkSpXNmRJjPAEMfcGPA9ZV85WA4jpaJv8d2RMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038