UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lbums/r6VVnWjKMd7qcwr26JotPB6k/uZ0X8uqB0k2U='
WHERE
key_id = 'faf0ff09755178ce89b58ac8cdcd3d6c63511783021e70baf01f4130abe3d7a6'
AND (
token = 'lbums/r6VVnWjKMd7qcwr26JotPB6k/uZ0X8uqB0k2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)