UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HnUnhBP4v9EieZrN92ChDIV3J4VKim9FKkdTWvNG4oQ=' 
WHERE 
  key_id = 'f5f4f5cc9c485bcd96cd37e6f5b8232d21fa2d4dc746cb40d9717e768e691380' 
  AND (
    token = 'HnUnhBP4v9EieZrN92ChDIV3J4VKim9FKkdTWvNG4oQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038