UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ioio4DNBc4ngqSwBP7HAKcNsYg5B1WatOCWIcmXMaFQ='
WHERE
key_id = '534f9faa32d37aeee2a24f69a201ea6594574c5808c5e471d4dfb79df6313f2a'
AND (
token = 'Ioio4DNBc4ngqSwBP7HAKcNsYg5B1WatOCWIcmXMaFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)