UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5TSZk1TcUWq+be6lH7GBFIXlbtLyqckugBqsSKixkEo='
WHERE
key_id = '69e41f3e33edb871a192bb3e3565fabed46683fa0ec3a3203ca27ac312874309'
AND (
token = '5TSZk1TcUWq+be6lH7GBFIXlbtLyqckugBqsSKixkEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)