UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pUTIFJPyBZV+2Q/aaQTUX/9fg0Lc471vyNYJxnsB9pQ='
WHERE
key_id = 'a556566df00f1359b52b01a7ad3efa69e02131774b78a2455619d3598f8b4972'
AND (
token = 'pUTIFJPyBZV+2Q/aaQTUX/9fg0Lc471vyNYJxnsB9pQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)