UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FEc5hBybXjvrZoTk5WHprz6oPEhQhVzDoeIKoyURi2U='
WHERE
key_id = '80b817044899c73af9ca92c967095f1ce6666e5d95a7d8831785952b20da2869'
AND (
token = 'FEc5hBybXjvrZoTk5WHprz6oPEhQhVzDoeIKoyURi2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)