UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OvufnW8fNfSdqGT1IU+2qGghdeLWEajCqHduBejuMn4=' 
WHERE 
  key_id = '3d6c28e6eab8641a0d6cf60baec7ee611848027f6cff498be28356270076351f' 
  AND (
    token = 'OvufnW8fNfSdqGT1IU+2qGghdeLWEajCqHduBejuMn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042