UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uiPrSIIb9j/Z8SfZaxSWfi3IS6YRjzRlc79iILVEdPs='
WHERE
key_id = '6dcc9e978ffb048a01b2024b7640e6be83f080ff52ccc06cff2d6a14077c54f1'
AND (
token = 'uiPrSIIb9j/Z8SfZaxSWfi3IS6YRjzRlc79iILVEdPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)