UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fty2zM2E8DsbNDJqc1yEn6qZcKwvuPiVGw07K/5L2IU='
WHERE
key_id = '30ab4defd90e08fd4a84ec66ebb23e787a5fa2e0cb137cfcf5ce28bf5efeed00'
AND (
token = 'Fty2zM2E8DsbNDJqc1yEn6qZcKwvuPiVGw07K/5L2IU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)