UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PX2H0ktEM3aICj5tFqyszuWVQ0rvnxTW5v/sJDnQbMU=' 
WHERE 
  key_id = 'b5d8ea62deac6a6ef8f99faef5c797550edbd4f924a61b439c39ca6b995491a8' 
  AND (
    token = 'PX2H0ktEM3aICj5tFqyszuWVQ0rvnxTW5v/sJDnQbMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026