UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7VvTxYyzbIEzyTx5dqc/3iZtc4RTylMjLeuHcQQpXyA='
WHERE
key_id = '4f63e66c8be2506bb526660c900928fa380de7635eb4f6935458ef37ee4cd4ec'
AND (
token = '7VvTxYyzbIEzyTx5dqc/3iZtc4RTylMjLeuHcQQpXyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)