UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1vkLfT/4QTQjX9u81VnkdPHv8NXOBpZv2nW4fQx+3o4=' 
WHERE 
  key_id = 'ed6213b95c1f6aeab1cbfb3d200264f28538dd4029d82e065b2e5a6a64e7569c' 
  AND (
    token = '1vkLfT/4QTQjX9u81VnkdPHv8NXOBpZv2nW4fQx+3o4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028