UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UttF3uV0SWA+q0hLRyiuj86ycC+MP2QT5M2l60D8O1Y=' 
WHERE 
  key_id = '79bfcbef1ab68cc11fc15da7588888d3b1a4d4d922f7d197b58584481d231705' 
  AND (
    token = 'UttF3uV0SWA+q0hLRyiuj86ycC+MP2QT5M2l60D8O1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025