UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o9KjPlB4zXOYx6iI3dQJClUrdvty1BDi9IFYEBRwvgQ='
WHERE
key_id = '23a32cf954df28a5140867b75de31601638994c233e661c20e5f33c95b06e135'
AND (
token = 'o9KjPlB4zXOYx6iI3dQJClUrdvty1BDi9IFYEBRwvgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)