UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+pVAYfizo9pmkiv0FSVCIBtwinrxS7AMMeB2/qUq2G0='
WHERE
key_id = 'e87be9cc24acca4ad0d774ac0a71c8f810d4089034ca22a2dd8a951ab49b5866'
AND (
token = '+pVAYfizo9pmkiv0FSVCIBtwinrxS7AMMeB2/qUq2G0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)