UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LTrS1cEmKkBNdVmVMrpKFN82vxgrR+brmo2/QndfW4='
WHERE
key_id = 'd0ee9be8c7f5d7ff67c3414f958019ebb7a6a858535a43cf0f914e56cc326af1'
AND (
token = '9LTrS1cEmKkBNdVmVMrpKFN82vxgrR+brmo2/QndfW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)