UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hpue5Ri57wpigEVhn/tKdwmoP5RnsTL5IZf4fiy9WNA='
WHERE
key_id = '16030900204061cb783c59725a2fbd74548e50960edd06a4f283a0f52992bb36'
AND (
token = 'Hpue5Ri57wpigEVhn/tKdwmoP5RnsTL5IZf4fiy9WNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)