UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WAx5esscbUf6Dfn0zwTAQLu6GaPIZUcBBYXRNd/zJvo=' 
WHERE 
  key_id = 'dff6ca34353080716dbcdb2dd6b7f04489819e55f8d19fdec7b14d89a98da8f2' 
  AND (
    token = 'WAx5esscbUf6Dfn0zwTAQLu6GaPIZUcBBYXRNd/zJvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030