UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rdiqpj3cnmxVWg/GQEEYiu1yT0OAbF19Kgt8SgyGoe4='
WHERE
key_id = 'a73bd9152fcc9683452da387964c26d52482e7f4291a0fe083c45bdc4c5ec92a'
AND (
token = 'Rdiqpj3cnmxVWg/GQEEYiu1yT0OAbF19Kgt8SgyGoe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)