UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PGo6bCB1GFU19d0BBs/yNfqaHnrx5/Of0gJBwH0I/KM='
WHERE
key_id = 'e712bdad4e1fee1a8aae80557e16fb706ac50970d93bb7335bfa95aaf9b89543'
AND (
token = 'PGo6bCB1GFU19d0BBs/yNfqaHnrx5/Of0gJBwH0I/KM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)