UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LB6e9n3na3Vzs2cDtSoELoONOL2/yARnu3mxHw9NLWU=' 
WHERE 
  key_id = '218f53e439c8c1fc5059667eba9eb19dcfead589c0f2d031b823d266b3649689' 
  AND (
    token = 'LB6e9n3na3Vzs2cDtSoELoONOL2/yARnu3mxHw9NLWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019