UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hQ53t2ZI4E0lM0d8+BeZloJVMsjv1PfOUq1SocFcsW4='
WHERE
key_id = '4de26369e0a3bb5534d494fe45f1d4bb4cb8bca3d9df474956fea3f942a41890'
AND (
token = 'hQ53t2ZI4E0lM0d8+BeZloJVMsjv1PfOUq1SocFcsW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)