UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKWEX3yCP/76li2XIj0qMYUxHPsxxjSuCZeUECCmwnw='
WHERE
key_id = 'bec5de5111ba326c965ef9f7f51afa9adb53d8672c3339618dbdfd6e8af52dcb'
AND (
token = 'XKWEX3yCP/76li2XIj0qMYUxHPsxxjSuCZeUECCmwnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)