UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2qiSZbQq30NVhHtzU8orSuvCamx05Fg/vWXbq7lsaY8=' 
WHERE 
  key_id = '4c73ac030f49f4260cc489b82ed3e921031ab0c2c240b6c1325ed47d339408cb' 
  AND (
    token = '2qiSZbQq30NVhHtzU8orSuvCamx05Fg/vWXbq7lsaY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023