UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4+UK6mKVfokGxW0LrKTVOxJ6PJZGzd25yrpyDRTBY0='
WHERE
key_id = '6f1ff88929c78bfafb30acec25c59969eeef1db4259a63146da4ae87959571de'
AND (
token = 'g4+UK6mKVfokGxW0LrKTVOxJ6PJZGzd25yrpyDRTBY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)