UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BJgG8c430c+S7RBW9Vz9B3n/gcdT2zuljxh1Fb7hkpM='
WHERE
key_id = '6c2551c5f55d3cb9e45eecf92bff6ea642be6b032dddc63c4f7bec23f9cf3d3f'
AND (
token = 'BJgG8c430c+S7RBW9Vz9B3n/gcdT2zuljxh1Fb7hkpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)