UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WVo+VkrzeFV3SobjdjBmtyhXbcCrrrH6U36seeHw/pc=' 
WHERE 
  key_id = 'b6a89f2c6c04a557179fb3c82d280db6248f6877a0e6d54841cffe2849fb9dbb' 
  AND (
    token = 'WVo+VkrzeFV3SobjdjBmtyhXbcCrrrH6U36seeHw/pc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031