UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lwK9TZFC5tj7ePjRMrdOod5pG9XU/UuJ299OUv3QsQ0='
WHERE
key_id = '24ae0501c66e4fb2146842c5b9f8ed4636948107287fa2e47d97e90b6fb224da'
AND (
token = 'lwK9TZFC5tj7ePjRMrdOod5pG9XU/UuJ299OUv3QsQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)