UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HZGLIFNkOmWPh0Q9AeDxjgLc/KW5wfTo1aIKl3BWXiE=' 
WHERE 
  key_id = '53d135f0ce2536758258ca11b0d9cf7fbeea0443c04d36a0b1e00556c44fa38d' 
  AND (
    token = 'HZGLIFNkOmWPh0Q9AeDxjgLc/KW5wfTo1aIKl3BWXiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033