UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K4+5qtWbvzgec1JSGKZRyuLxwEFvzcKPqyKfFzibs4A='
WHERE
key_id = '83713067c884c75de431f00eb0b9bc4c176ec9f4b226f2768f1eac4383d2881e'
AND (
token = 'K4+5qtWbvzgec1JSGKZRyuLxwEFvzcKPqyKfFzibs4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)