UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IIjIsWMMIRuDDtojEfS4Lmw7vswm+cEeQ72vfyhilGI='
WHERE
key_id = '56ae1c6e2f693308c365b7c67bedd402639ad52e9ca6a049ae7340820e8f57fb'
AND (
token = 'IIjIsWMMIRuDDtojEfS4Lmw7vswm+cEeQ72vfyhilGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)