UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kbxdrzIaG7KRdB4eY6qA09NJtoC3bexbHDK2McyF3og='
WHERE
key_id = '42ed790013b8e475ab8154569d11e0ddd767820fd0c28cc172b9e424f31cd97b'
AND (
token = 'kbxdrzIaG7KRdB4eY6qA09NJtoC3bexbHDK2McyF3og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)