UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AZOo5Zfmn/M+Frialm8LTxFh4AIbe2tWptii4DdCIcA='
WHERE
key_id = '76049067a8ba807a5ed40f3feaedcab4058f0c5955d8a0050a563b8fe983ecf1'
AND (
token = 'AZOo5Zfmn/M+Frialm8LTxFh4AIbe2tWptii4DdCIcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)